from math import sin, cos, radians, sqrt theta0 = input() theta0 = radians(theta0) theta1 = input() theta1 = radians(theta1) theta2 = input() theta2 = radians(theta2) #print theta iter = input() x = input() y = input() z = complex(x,y) #print z.real, z.imag denom1 = (z.real)*(z.real)+(z.imag)*(z.imag)+1.0 X = 2.*z.real/denom1 Y = 2.*z.imag/denom1 Z = ((z.real)*(z.real)+(z.imag)*(z.imag)-1.0)/denom1 print z.real, z.imag,X,Y,Z for n in range(1,iter): c2 = (n%3)>>1 c1 = (n%3)%2 c0 = 1 - ( ((n%3)&1)^(((n%3)&2)>>1) ) #Trois choix, selon reste de la division de n par 3 theta = c0*theta0 + c1*theta1 + c2*theta2 z1 = (cos(theta)*z-sin(theta))/(sin(theta)*z+cos(theta)) denom1 = (z1.real)*(z1.real)+(z1.imag)*(z1.imag)+1.0 X = 2.*z1.real/denom1 Y = 2.*z1.imag/denom1 Z = ((z1.real)*(z1.real)+(z1.imag)*(z1.imag)-1.0)/denom1 print z1.real, z1.imag, X, Y, Z z =z1